<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>

        let domString = '<div><span>哈哈哈</span></div>'
        // 利用正则获取标签
        let reg = /<\/?[a-z][a-z]*>/ig
        let string1 = domString.match(reg)
        console.log(string1);

        /*
            ? {0,1}
            * {0,}
            + {1,}
        */

        

    </script>

</body>
</html>